package com.zx.feign.client;

import com.zx.core.wrapper.ObjectWrapper;
import com.zx.feign.client.dto.GetLoginUserResponseDTO;
import com.zx.feign.client.dto.GetSysUserResponseDTO;
import com.zx.feign.client.fallbackfactory.SystemClientFallbackFactory;
import com.zx.feign.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 * description: 系统服务客户端接口<br>
 * create: 2025-04-23 10:03 <br>
 * </p>
 *
 * @author zhou  xun
 */
@FeignClient(value = "zx-system-block", fallbackFactory = SystemClientFallbackFactory.class, configuration = FeignConfig.class)
public interface SystemClient {
    /**
     * 获取用户信息
     *
     * @param userName 用户名
     * @return 用户信息
     */
    @GetMapping("/user/info/{userName}")
    ObjectWrapper<GetLoginUserResponseDTO> getUserInfo(@PathVariable("userName") String userName);

    /**
     * 根据登录凭证获取用户信息
     *
     * @param loginCredential 登录凭证（用户名、手机号或邮箱）
     * @return 用户信息
     */
    @GetMapping("/user/info/credential/{loginCredential}")
    ObjectWrapper<GetLoginUserResponseDTO> getUserInfoByLoginCredential(@PathVariable("loginCredential") String loginCredential);

    /**
     * 获取用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     */
    @GetMapping("/user/{userId}")
    ObjectWrapper<GetSysUserResponseDTO> getUserInfoById(@PathVariable("userId") String userId);

}